package spi;

import spi.impl.EnHello;
import spi.mySpi.mySpi;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;


//自定义spi
public class mySpi_test {

    public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IOException, InvocationTargetException {
        Hello helloInstance = mySpi.getInstance("Hello", "En");
        helloInstance.sayHello();
        if (helloInstance instanceof EnHello) {
            System.out.println(((EnHello) helloInstance).getWord());
        }
    }
}
